package com.sp.scmdb.entity;

import java.util.HashMap;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

import com.sp.scmdb.common.DomainObject;

@Entity
@Table(name = "OBJ_EMPDAYREPORT")
public class EmpDayReport extends DomainObject {

	@Column(name = "labelID", nullable = false)
	private Integer labelID;

	@Column(name = "empID", nullable = false)
	private Integer empID;

	@Column(name = "gong")
	private Integer gong;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empID", insertable = false, updatable = false)
	@NotFound(action=NotFoundAction.IGNORE) 
	private Employee employee;

	@Column(name = "realTime")
	private String realTime;

	@Column(name = "rmk")
	private String rmk;

	@Column(name = "dataMap")
	@Type(type = "com.sp.scmdb.entityType.DataMapUserType", parameters = {
			@org.hibernate.annotations.Parameter(name = "keyType", value = "org.joda.time.DateTime"),
			@org.hibernate.annotations.Parameter(name = "valueType", value = "org.joda.time.DateTime") })
	private java.util.Map<DateTime, DateTime> dataMap = new HashMap<DateTime, DateTime>();

	public String getRealTime() {
		return realTime;
	}

	public void setRealTime(String realTime) {
		this.realTime = realTime;
	}

	public java.util.Map<DateTime, DateTime> getDataMap() {
		return dataMap;
	}

	public void setDataMap(java.util.Map<DateTime, DateTime> dataMap) {
		this.dataMap = dataMap;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public Integer getLabelID() {
		return labelID;
	}

	public void setLabelID(Integer labelID) {
		this.labelID = labelID;
	}

	public Integer getEmpID() {
		return empID;
	}

	public void setEmpID(Integer empID) {
		this.empID = empID;
	}

	public Integer getGong() {
		return gong;
	}

	public void setGong(Integer gong) {
		this.gong = gong;
	}

	public String getRmk() {
		return rmk;
	}

	public void setRmk(String rmk) {
		this.rmk = rmk;
	}

}
